<?
	include($_SERVER['DOCUMENT_ROOT'].'/admin/template.php');
	
	$daysOfWeek = array("Montag", "Dienstag", "Mittwoch", "Donnerstag", "Freitag", "Samstag", "Sonntag");
	$daysOfWeekUpper = array("MONTAG", "DIENSTAG", "MITTWOCH", "DONNERSTAG", "FREITAG", "SAMSTAG", "SONNTAG");
	$wholeText = $_POST["wochenplan"];
?>
<form method = "post" action = "/admin/handleManualEntry.php">
	<table>
		<?
			for($i = 1; $i <= 5; ++$i)
			{
				$wholeText =str_replace($daysOfWeekUpper[$i],$daysOfWeek[$i], $wholeText);
				$text = returnBetween($wholeText, $daysOfWeek[$i-1], $daysOfWeek[$i]);
				$comp = stripos($wholeText, $daysOfWeek[$i-1]);
				if ($comp === false)
				{
					$text = 'Ruhetag';
				}
		?>
		<tr>
			<td><b><?= $daysOfWeek[$i-1] ?>:</b></td>
		</tr>
		<tr>
			<td><? drawTextArea("day$i", $text); ?></td>
		</tr>
		<?
			}
		?>
		<tr>
			<td>
				<input name = "restId" type = "hidden" value = "<?= $_POST["rest_id"]; ?>">
				<input name = "weekNr" type = "hidden" value = "<?= $_POST["week"]; ?>">
			</td>
			<td><input type = "submit" value = "Eintragen"></td>
		</tr>
	</table>
</form>